<div class="wrap">
    <div id="icon-upload" class="icon32"><br></div>
    <h2>Datové rámce ve snímku "{$slide.name}" <a href="{link target='self:addSlide'}" class="add-new-h2">Přidat datový rámec</a> </h2>
    {include file="messages.tpl"}
    <form id="posts-filter" action="{link target='self:itemBulkAction'}" method="post">
        <input name="token" type="hidden" value="{wp_nonce target='self:itemBulkAction'}" />
        <input name="slideId" type="hidden" value="{$slide.slideId}" />
        <div class="tablenav top">
            <div class="alignleft actions">
                <select name="action1">
                    <option value="-1" selected="selected">Hromadné úpravy</option>
                    <option value="remove">Odstranit</option>
                </select>
                <input type="submit" name="" id="doaction" class="button-secondary action" value="Použít">
            </div>
            {include file="pager.tpl" position='top' pager=$pager page='editItems' append='orderBy,order'}
            <br class="clear">
        </div>
        <table class="wp-list-table widefat fixed pages" cellspacing="0">
            <thead>
                <tr>
                    <th scope="col" id="cb" class="manage-column column-cb check-column">
                        <input type="checkbox">
                    </th>    
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='name'}" style="">
                        <a href="{sortlink orderBy='name' append='paged,slideId'}"><span>Název</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='zoneId'}">
                        <a href="{sortlink orderBy='zoneId' append='paged,slideId'}"><span>Zóna</span><span class="sorting-indicator"></span></a>
                    </th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th scope="col" id="cb" class="manage-column column-cb check-column">
                        <input type="checkbox">
                    </th>    
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='name'}" style="">
                        <a href="{sortlink orderBy='name' append='paged,slideId'}"><span>Název</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='zoneId'}">
                        <a href="{sortlink orderBy='zoneId' append='paged,slideId'}"><span>Zóna</span><span class="sorting-indicator"></span></a>
                    </th>
                </tr> 
            </tfoot>
            <tbody id="the-list">
                {foreach $slide_items as $slide_item} 
                <tr class="{cycle values='alternate,'}" valign="top">
                    <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="{$slide_item.itemId}"></th>                    
                    <td class="post-title page-title column-title">                        
                        <strong>
                            <a href="{link target='dataframe:editItems' frameId=$slide_item.frameId}">{$slide_item.name|escape}</a>
                        </strong>
                        <div class="row-actions">                            
                            <span class="trash"><a class="submitdelete" title="Přesunout tuto položku do koše" href="{link target='self:removeItem' itemId=$slide_item.itemId append='slideId' token='true'}">Odstranit</a></span>
                        </div>
                    </td> 
                    <td class="post-title page-title column-title">
                        {$slide_item.zoneId|escape}
                    </td>                    
                </tr>
                {foreachelse}
                <tr>
                    <td colspan="3">Nejsou zadány žádné položky.</td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        <div class="tablenav bottom">
            <div class="alignleft actions">
                <select name="action2">
                    <option value="-1" selected="selected">Hromadné úpravy</option>
                    <option value="remove">Odstranit</option>
                </select>
                <input type="submit" name="" id="doaction2" class="button-secondary action" value="Použít">
            </div>
            <div class="alignleft actions">
            </div>
            {include file="pager.tpl" pager=$pager page='editItems' append='orderBy,order'}
            <br class="clear">
        </div>
    </form>
    {if count($zones) > 0}
    <form name="addlink" id="addlink" method="post" action="{link target='self:editItems' append='slideId'}" style="width: 500px">
        <input type="hidden" name="action" value="add">
        <div id="poststuff" class="metabox-holder">            
            <div id="post-body">
                <div id="post-body-content">
                    <div class="stuffbox">
                        <h3><label for="link_name">Nový datový zdoj</label></h3>
                        <div class="inside"> 
                            <table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
                                <tbody>
                                    <tr class="form-field">
                                        <th valign="top" scope="row"><label for="item[frameId]">Datový rámec</label></th>
                                        <td>{html_options name="item[frameId]" options=$data_frames selected=$item.frameId}</td>
                                    </tr>
                                    <tr class="form-field">
                                        <th valign="top" scope="row"><label for="item[targetId]">Vysílací zóna</label></th>
                                        <td>{html_options name="item[zoneId]" options=$zones selected=$item.zoneId}</td>
                                    </tr>                            
                                </tbody>
                            </table>
                        </div>
                        <div class="ads-form-footer">
                            <div id="major-publishing-actions">
                                <div id="delete-action">
                                    <input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="Přidat datový zdroj">
                                </div>
                                <div id="publishing-action">

                                </div>
                                <div class="clear"></div>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    {/if}
</div>
